
package com.tzkyzj.tiremanager.entity;



public enum TirePosition {
    // 1轴
    AXLE1_LEFT_OUTER("1轴左外", 1, "左外", 150, 300),
    AXLE1_LEFT_INNER("1轴左内", 1, "左内", 180, 300),
    AXLE1_RIGHT_INNER("1轴右内", 1, "右内", 420, 300),
    AXLE1_RIGHT_OUTER("1轴右外", 1, "右外", 450, 300),

    // 2轴
    AXLE2_LEFT_OUTER("2轴左外", 2, "左外", 150, 350),
    AXLE2_LEFT_INNER("2轴左内", 2, "左内", 180, 350),
    AXLE2_RIGHT_INNER("2轴右内", 2, "右内", 420, 350),
    AXLE2_RIGHT_OUTER("2轴右外", 2, "右外", 450, 350),

    // 3-6轴类似定义...
    AXLE3_LEFT_OUTER("3轴左外", 3, "左外", 150, 400),
    AXLE3_LEFT_INNER("3轴左内", 3, "左内", 180, 400),
    AXLE3_RIGHT_INNER("3轴右内", 3, "右内", 420, 400),
    AXLE3_RIGHT_OUTER("3轴右外", 3, "右外", 450, 400),

    AXLE4_LEFT_OUTER("4轴左外", 4, "左外", 150, 450),
    AXLE4_LEFT_INNER("4轴左内", 4, "左内", 180, 450),
    AXLE4_RIGHT_INNER("4轴右内", 4, "右内", 420, 450),
    AXLE4_RIGHT_OUTER("4轴右外", 4, "右外", 450, 450),

    AXLE5_LEFT_OUTER("5轴左外", 5, "左外", 150, 500),
    AXLE5_LEFT_INNER("5轴左内", 5, "左内", 180, 500),
    AXLE5_RIGHT_INNER("5轴右内", 5, "右内", 420, 500),
    AXLE5_RIGHT_OUTER("5轴右外", 5, "右外", 450, 500),

    AXLE6_LEFT_OUTER("6轴左外", 6, "左外", 150, 550),
    AXLE6_LEFT_INNER("6轴左内", 6, "左内", 180, 550),
    AXLE6_RIGHT_INNER("6轴右内", 6, "右内", 420, 550),
    AXLE6_RIGHT_OUTER("6轴右外", 6, "右外", 450, 550);

    private final String displayName;
    private final int axleNumber;
    private final String position;
    private final int x;
    private final int y;

    TirePosition(String displayName, int axleNumber, String position, int x, int y) {
        this.displayName = displayName;
        this.axleNumber = axleNumber;
        this.position = position;
        this.x = x;
        this.y = y;
    }

    // 根据轴数和位置获取枚举
    public static TirePosition getByAxleAndPosition(int axleNumber, String position) {
        for (TirePosition tp : values()) {
            if (tp.axleNumber == axleNumber && tp.position.equals(position)) {
                return tp;
            }
        }
        return null;
    }

    // Getters
    public String getDisplayName() { return displayName; }
    public int getAxleNumber() { return axleNumber; }
    public String getPosition() { return position; }
    public int getX() { return x; }
    public int getY() { return y; }
}
